package com.user.demo.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xsy
 * @createTime 2023/2/5  13:28
 * @description
 * @since 1.0
 */
@RestController
@RequestMapping("/api")
public class UserController {
    @GetMapping("/getTest")
    @PreAuthorize("hasRole('ROLE_ADMIN')")
    public String getTest(){
        return "访问资源1";
    }
}
